<?php

namespace Mlym\CodeGeneration\Middleware\Api;
use EasySwoole\Spl\SplBean;
use Exception;

class Config extends SplBean
{
    protected $url;
    protected $project;
    protected $module;

    /**
     * @return mixed
     * @throws Exception
     */
    public function getUrl()
    {
        if (empty($this->url)){
            throw new Exception('project not url');
        }
        return $this->url;
    }

    /**
     * @param mixed $url
     */
    public function setUrl($url): void
    {
        $this->url = $url;
    }

    /**
     * @return mixed
     * @throws Exception
     */
    public function getProject()
    {
        if (empty($this->project)){
            throw new Exception('project not empty');
        }
        return $this->project;
    }

    /**
     * @param mixed $project
     */
    public function setProject($project): void
    {
        $this->project = $project;
    }

    /**
     * @return mixed
     * @throws Exception
     */
    public function getModule()
    {
        if (empty($this->module)){
            throw new Exception('module not empty');
        }
        return $this->module;
    }

    /**
     * @param mixed $module
     */
    public function setModule($module): void
    {
        $this->module = $module;
    }


}